package org.gruposp2p.proyectokarma.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.GeneratedValue;

@Entity
@Table(name="PeerKarmaParameter")
public class PeerKarmaParameter  implements java.io.Serializable {

	 private static final long serialVersionUID = 1L;
	 
	 @Id @GeneratedValue(strategy=IDENTITY)
     @Column(name="id", unique=true, nullable=false)
     private Long id;
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="peerId", nullable=false)
     private Peer peer;
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="karmaParameterId", nullable=false)
     private KarmaParameter karmaParameter;
     @Column(name="balance", nullable=false, precision=10, scale=0)
     private long balance;

    public PeerKarmaParameter() { }

    public PeerKarmaParameter(Long id, Peer peer, KarmaParameter karmaParameter, long balance) {
       this.id = id;
       this.peer = peer;
       this.karmaParameter = karmaParameter;
       this.balance = balance;
    }
   
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }

    public Peer getPeer() {
        return this.peer;
    }
    
    public void setPeer(Peer peer) {
        this.peer = peer;
    }

    public KarmaParameter getKarmaParameter() {
        return this.karmaParameter;
    }
    
    public void setKarmaParameter(KarmaParameter karmaParameter) {
        this.karmaParameter = karmaParameter;
    }

    public long getBalance() {
        return this.balance;
    }
    
    public void setBalance(long balance) {
        this.balance = balance;
    }

}


